package com.yuxi.juanzi.topic4;

public class StudentTest {
    public static void main(String[] args) {
        Student s1 = new Student(1, "王一", "男", 18, 54);
        Student s2 = new Student(1, "王二", "男", 18, 55);
        Student s3 = new Student(1, "王三", "男", 18, 56);
        Student s4 = new Student(1, "王四", "男", 18, 57);
        Student s5 = new Student(1, "王五", "男", 18, 58);

        s1.Show();
        s2.Show();
        s3.Show();
        s4.Show();
        s5.Show();

        double sum = s1.getsJava()+s2.getsJava()+s3.getsJava()+s4.getsJava()+s5.getsJava();
        double avg = sum/5;

        double[] arr = new double[5];
        arr[0] = s1.getsJava();
        arr[1] = s2.getsJava();
        arr[2] = s3.getsJava();
        arr[3] = s4.getsJava();
        arr[4] = s5.getsJava();
        double max = 0,min = arr[0];
        for (double v : arr) {
            if (max<v){
                max = v;
            }
            if (min>v){
                min = v;
            }
        }
        System.out.println("他们 Java 语言成绩的最大值为："+max+
                "最小值为："+min);

    }
}
